//
//  ViewController.swift
//  ContentButtonDemo
//
//  Created by hongyan.yang on 2022/2/23.
//

import UIKit

class ViewController: UIViewController {

    @IBOutlet weak var lightStyleButton: ContentButton!
    @IBOutlet weak var darkStyleButton: ContentButton!
    @IBOutlet weak var underlinedStyleButton: ContentButton!
    @IBOutlet weak var iconStyleButton: ContentButton!
    override func viewDidLoad() {
        super.viewDidLoad()
        lightStyleButton.style = .light
        darkStyleButton.style = .dark
        underlinedStyleButton.style = .underlined
        iconStyleButton.style = .icon
    }


    @IBAction func contentButtonAction(_ sender: ContentButton) {
        sender.content = .inProgress
        DispatchQueue.global().async {
            // do something
            DispatchQueue.main.asyncAfter(deadline: .now()+2.0) {
                sender.content = .default
            }
        }
    }
}

